<?php
session_start();
if(isset($_GET["page"]) && !is_file('./histo/'.$_GET["page"].'.php'))
{
	header("Location: /PPE4-vhb-sio-ppe-histostage/accueil.php");
}
else
{
	?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>Site intranet de la section STS IG-SIO</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link href="styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<script language="javascript" type="text/javascript">
var i = 0;
	function AfficherParagraphe() {	
		if(document.getElementById("adminCnx").getAttribute("style") == "display:none" || i == 0) {
			$("#adminCnx").fadeIn(1500);
			//document.getElementById("adminCnx").setAttribute("style","display:block");	
			i = 1;
		} else {
			$("#adminCnx").fadeOut(1500);
			setTimeout($("#login").val(''), 1500);
			setTimeout($("#mdp").val(''), 1500);
			i = 0;
		}
	}
</script>
</head>
<body>
	<div id="entete">
		<!--      <img src="img/logo.jpg" class="logo" alt="logo" /> -->
		<h1>
			<a href="?page=#">Site intranet de la section STS IG-SIO</a>
		</h1>
	</div>

	<div id="menugauche">
		<ul id="menulist">
			<li><a href="?page=listeOrganisations#">Activites SIO</a></li>
			<li>
				<ul class="activites">
					<li><a href="?page=activitesP1">Processus P1</a></li>
					<li><a href="?page=activitesP2">Processus P2</a></li>
					<li><a href="?page=activitesP3">Processus P3</a></li>
					<li><a href="?page=activitesP4">Processus P4</a></li>
					<li><a href="?page=activitesP5">Processus P5</a></li>
				</ul>
			</li>
			<li><a href="?page=listeOrganisations#">Historique des stages</a></li>
			<li>
				<ul class="activites">
					<li><a href="?page=listeOrganisations">Liste des organisations</a>
					</li>
					<li><a href="?page=rechercheStagesCriteres">Recherche stages</a></li>
				</ul>
			</li>
			<li><a href="?page=adressesSites">Liens sites stages</a></li>
			<?php
			if(isset($_SESSION['admin'])) {
				if($_SESSION['admin'] = true) {
					?>
			<li>
				<ul id="adminLi">
					<li><a href="?page=ajoutOrga">Ajouter une Organisation</a></li>
					<li><a href="?page=modifOrga">Modifier une Organisation</a></li>
					<li><a href="?page=deconnexion">Se deconnecter</a></li>
				</ul>
			</li>
			<?php
				}
			} else {
				?>
			<ul id="menulist">
				<a href="javascript:AfficherParagraphe()">Page d'administration</a>
			</ul>
			<br />
			<div id="adminCnx" style="display: none">
				<form action="?page=admin" method="post">
					<label>Identifiant</label>
					<input id="login" type="text" name="login" />
					<br />
					<label>Mot de passe</label>
					<input id="mdp" type="password" name="mdp" />
					<input id="ok" type="submit" />
				</form>
			</div>
			<?php
			}
			?>
		</ul>
	</div>


	<div id="contenu">
		<?php 
		if(isset($_GET["page"]) && is_file('./histo/'.$_GET["page"].'.php'))
		{
			$page = $_GET["page"];
			include('./histo/'.$page.'.php');
	 }
	 ?>
	</div>

	<!-- Division pour le pied de page -->
	<div id="pied">
		<p id="logoValidW3c">
			<a href="http://validator.w3.org/check?uri=referer"><img
				src="http://www.w3.org/Icons/valid-xhtml10"
				alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
		</p>
		<p id="libValidW3c">Cette page est conforme aux standards du Web</p>
	</div>
</body>
</html>
<?php 
}?>